package com.cloud.client.service;

import com.cloud.client.service.fallback.AuthFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @packageName: com.cloud.client.service.auth;
 * @name: AuthService
 * @description: 权限相关服务
 * @author: 董定卓
 * @dateTime: 2019/7/12 15:20
 */
@FeignClient(name = "service-gateway-auth", path = "/service-auth", url = "${gateway.url}", fallback = AuthFallback.class)
public interface AuthService {

    /**
     * 用户登录
     *
     * @param map
     * @return
     */
    @PostMapping(value = "/login")
    Object login(@RequestParam Map<String, Object> map);

    /**
     * 用户退出
     *
     * @param map
     * @return
     */
    @PostMapping(value = "/logout")
    Object logout(@RequestParam Map<String, Object> map);

    /**
     * 权限分页列表
     *
     * @param map
     * @return
     */
    @PostMapping("/permission/page")
    Object permissionPage(@RequestParam Map<String, Object> map);

    /**
     * 添加角色
     *
     * @param map
     * @return
     */
    @PostMapping("/role/add")
    Object roleAdd(@RequestParam Map<String, Object> map);

    /**
     * 删除角色
     *
     * @param map
     * @return
     */
    @PostMapping("/role/del")
    Object roleDel(@RequestParam Map<String, Object> map);

    /**
     * 更新角色
     *
     * @param map
     * @return
     */
    @PostMapping("/role/update")
    Object roleUpdate(@RequestParam Map<String, Object> map);

    /**
     * 角色分页
     *
     * @param map
     * @return
     */
    @PostMapping("/role/page")
    Object rolePage(@RequestParam Map<String, Object> map);

    /**
     * 添加用户
     *
     * @param map
     * @return
     */
    @PostMapping("/user/add")
    Object userAdd(@RequestParam Map<String, Object> map);

    /**
     * 删除用户
     *
     * @param map
     * @return
     */
    @PostMapping("/user/del")
    Object userDel(@RequestParam Map<String, Object> map);

    /**
     * 用户修改密码
     *
     * @param map
     * @return
     */
    @PostMapping("/user/updatePassword")
    Object userUpdatePassword(@RequestParam Map<String, Object> map);

    /**
     * 更新用户信息
     *
     * @param map
     * @return
     */
    @PostMapping("/user/updateInfo")
    Object userUpdateInfo(@RequestParam Map<String, Object> map);

    /**
     * 用户分页
     *
     * @param map
     * @return
     */
    @PostMapping("/user/page")
    Object userPage(@RequestParam Map<String, Object> map);


    /**
     * 添加用户角色
     *
     * @param map
     * @return
     */
    @PostMapping("/userRole/Add")
    Object userRoleAdd(@RequestParam Map<String, Object> map);

    /**
     * 用户角色列表
     *
     * @param map
     * @return
     */
    @PostMapping("/userRole/list")
    Object userRoleList(@RequestParam Map<String, Object> map);

    /**
     * 角色权限添加
     *
     * @param map
     * @return
     */
    @PostMapping("/rolePermission/Add")
    Object rolePermissionAdd(@RequestParam Map<String, Object> map);

    /**
     * 角色权限列表
     *
     * @param map
     * @return
     */
    @PostMapping("/rolePermission/list")
    Object rolePermissionList(@RequestParam Map<String, Object> map);


}
